package com.back.demo.mapper;

import com.back.demo.common.Permission;
import com.back.demo.common.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

//import java.util.List;

@Mapper
@Repository
public interface BasicMapper {

    ArrayList<Integer> selectRoleIdByUsername(@Param("username") String username);

    User selectUserByUsername(@Param("username") String username);

    void register(User user);

    ArrayList<Permission> selectPermissionByUsername(@Param("username") String username);

    User selectInformationByUsername(@Param("username") String username);

    void changePassword(@Param("username") String username, @Param("newPassword") String newPassword);

    Integer getUserId(@Param("username") String username);

    Integer getRole(@Param("userid") Integer userid);

    String getStudentName(@Param("userid") Integer userid);

    String getJudgeName(@Param("userid") Integer userid);

    String getAdminName(@Param("userid") Integer userid);
}